
package org.moyakarta.rest;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class PlaceServiceBootstrap implements ServletContextListener
{
   static final String PLACE_STORAGE_NAME = PlaceStorage.class.getName();

   public void contextDestroyed(ServletContextEvent sce)
   {
      ServletContext sctx = sce.getServletContext();
      sctx.removeAttribute(PLACE_STORAGE_NAME);
   }

   public void contextInitialized(ServletContextEvent sce)
   {
      ServletContext sctx = sce.getServletContext();
      sctx.setAttribute(PLACE_STORAGE_NAME, new PlaceStorage());
   }
}
